package net.lijingye.education.dao;

import net.lijingye.education.exception.DaoException;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;

/**
 * Created by LijingYe on 2016/3/29.
 */
public interface BaseDao<T extends Serializable> {
    T getById(Serializable id) throws DaoException;

    T getByQuery(String queryString) throws DaoException;

    void save(T entity) throws DaoException;

    void update(T entity) throws DaoException;

    void saveOrUpdate(T entity) throws DaoException;

    void delete(T entity) throws DaoException;

    List<T> findByQuery(String queryString) throws DaoException;

    List<T> findAll() throws DaoException;
}
